package com.example.springbootcaffeinedemo.config;
import com.github.benmanes.caffeine.cache.CacheLoader;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by IntelliJ IDEA2022.3.2
 * @Author: Tenghw
 * @Date: 2023/04/18  16:43
 * @Description: 配置类
 */
@Configuration
public class CacheConfig {
    @Bean
    public CacheLoader<String,Object> cacheLoader(){
        return new CacheLoader<String, Object>() {
            @Override
            public @Nullable Object load(@NonNull String s) throws Exception {
                return null;
            }
            @Override
            public @Nullable Object reload(String key,Object oldValue) throws Exception {
                return oldValue;
            }
        };
    }
}
